<template>
	<tui-list-cell :lineLeft="false" @tap="$emit('toProduct', data)">
	  <view class="tui-comment-order-item">
	    <view class="tui-item-pic">
	    	<image :src="data.productItemPic" mode="aspectFill" class="pic-image"></image>
	    </view>
		<view class="tui-item-content">
			<view class="tui-item-name">
				{{data.productItemName}}
			</view>
			<view class="tui-item-sub-name">
				<button v-if="isComment === 0" type="text" class="do-comment-btn" @tap.stop="$emit('toComment', data)">评价</button>
				<button v-else type="text" class="do-comment-btn commented" @tap.stop="() => {}">已评价</button>
			</view>
		</view>
	  </view>
	</tui-list-cell>
</template>

<script>
	export default {
		props: {
			data: {
				type: Object,
				default: () => ({})
			},
			isComment: {
				type: Number,
				default: 0
			}
		},
		data() {
			return {
				
			}
		},
		methods: {
			
		}
	}
</script>

<style lang="scss">
	.tui-comment-order-item {
		display: flex;
		.tui-item-pic {
			width: 180rpx;
			height: 180rpx;
			overflow: hidden;
			border-radius: 8rpx;
			.pic-image {
				width: 180rpx;
				height: 180rpx;
			}
		}
		.tui-item-content {
			display: flex;
			flex-direction: column;
			justify-content: space-between;
			flex: 1;
			width: 0;
			padding-left: 30rpx;
			.tui-item-name {
				display: -webkit-box;
				overflow: hidden;
				text-overflow: ellipsis;
				word-wrap: break-word;
				white-space: normal !important;
				-webkit-line-clamp: 2;
				-webkit-box-orient: vertical;
			}
			.tui-item-sub-name {
				display: flex;
				justify-content: flex-end;
				.do-comment-btn {
					border: 1px solid #eb0909;
					color: #eb0909;
					border-radius: 29rpx;
					width: 120rpx;
					height: 55rpx;
					display: flex;
					align-items: center;
					justify-content: center;
					background: #f7a8a8;
					font-size: 28rpx;
				}
				.commented {
					border: 1px solid #eee;
					background: #ccc;
					color: #eee;
				}
			}
		}
	}
</style>
